home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / jazlib.arc / JZSETATR.DMO < prev    next >
Text File  |  1988-12-18  |  894b  |  37 lines

  1. #include "jzdirect.h"
  2. main(argc,argv)
  3. int argc;
  4. char **argv;
  5. {
  6.  
  7.   char name[50];
  8.   int attr,werror,attrcode,old;
  9.   TDIR wdir;
  10.  
  11.   if (argc < 3) {
  12.     printf("\nThis small program allows you to change file attributes");
  13.     printf("\nby specific file name or using wildcards.");
  14.     printf("\n- Jack A. Zucker (Jaz) 75766,1336");
  15.     printf("\n\nUSAGE:  jzsetatr <Filename> <file attribute>");
  16.     exit();
  17.   }
  18.  
  19.   werror = jzfndfst(*++argv,0xFF,&wdir);
  20.  
  21.   if (werror == 0) {
  22.     attr = atoi(*++argv);
  23.     do {
  24.       old = jzgetatr(wdir.name);
  25.       attrcode = jzsetatr(wdir.name,attr);
  26.       if (attrcode == 0)
  27.     printf("\nChanging attribute of %s from %d to %d",wdir.name,old,attr);
  28.       else
  29.      printf("\nUnable to change attribute of %s",wdir.name);
  30.       werror = jzfndnxt(&wdir);
  31.     } while (werror == 0);
  32.   }
  33.   else
  34.     printf("\nNo matching Files.");
  35. }
  36.  
  37.